-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(amazonq): enable code actions for awesome lightbulb #5620
Conversation
This pull request modifies files in src/ but no tests were added/updated. Confirm whether tests should be added or ensure the PR description explains why tests are not required. |
This pull request modifies a feature or fixes a bug, but it does not include a changelog entry. All pull requests that introduce new features or bug fixes must have a corresponding changelog item describing the changes. |
@32teeth the changelog here its added by a command. Check the CONTRIBUTING.md file, there is some set of commands that you can run and add that automatically. |
bfdd060
to
cb6bd30
Compare
Wicked, thanks for the heads up. Ran |
|
||
private suffix: string = 'using Amazon Q' | ||
|
||
private commands: Map<string, { title: string; kind: vscode.CodeActionKind }> = new Map< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create an abstract class (or a common class) CodeActions
in shared
and pass the following commands
during Amazon Q
activation. That way, we can share most of the logic in Toolkits and the Q Extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. We can itemize as a fast follow
vscode.CodeActionKind.Empty, | ||
] | ||
|
||
private suffix: string = 'using Amazon Q' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be parametrized as well so that the code can be shared by Amazon Q and Toolkits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a preference as to where to add consts
in the source code?
@@ -0,0 +1,4 @@ | |||
{ | |||
"type": "Feature", | |||
"description": "feat(amazonq): enable code actions for awesome lightbulb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including a changelog. Please review the changelog guidelines. Is this the most meaningful thing we can say about this improvement for customers that will be interested in it?
|
||
import * as vscode from 'vscode' | ||
|
||
export class CodeActions implements vscode.CodeActionProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice that there is a app/chat/ for application code for AmazonQ.
If this CodeActions module is generally useful for all Q features, it could live in packages/amazonq/src/util/
or packages/amazonq/src/shared/
. If it's for a particular Q feature, it should live in app/<feature>/
.
Or it could live in app/
directly.
The main point is that the top-level src/
directory isn't the right place for most code files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Will review
Closing due to inactivity |
Problem
The Amazon Q VS Code extension requires a more streamlined approach to handle various CodeAction scenarios such as quick fixes, refactoring, and code explanation for better user experience.
Solution
CodeActions
provider that dynamically generates and registers various actions (e.g.,QuickFix
,RefactorRewrite
,ExplainCode
) based on user selection.Key Changes:
extension.ts
to ensure proper extension initialization and handling for both the Node.js and web environments.CodeActions
class to provide code actions like explaining, refactoring, and fixing code with a dynamic selection mechanism.License: I confirm that my contribution is made under the terms of the Apache 2.0 license.